livepatch: Add per-function applied/reverted state tracking marker
authorPawel Wieczorkiewicz <wipawel@amazon.de>
Tue, 26 Nov 2019 10:07:56 +0000 (10:07 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 13 Dec 2019 14:45:32 +0000 (14:45 +0000)
commit6047104c3ccc50205464a9b6a90daa85d21a4798
treea98cad05beda568f7bc28aef2fff305628fb9c04
parent76b3d4098a92a323a43bc250c67c721c1eed0acb
livepatch: Add per-function applied/reverted state tracking marker

Livepatch only tracks an entire payload applied/reverted state. But,
with an option to supply the apply_payload() and/or revert_payload()
functions as optional hooks, it becomes possible to intermix the
execution of the original apply_payload()/revert_payload() functions
with their dynamically supplied counterparts.
It is important then to track the current state of every function
being patched and prevent situations of unintentional double-apply
or unapplied revert.

To support that, it is necessary to extend public interface of the
livepatch. The struct livepatch_func gets additional field holding
the applied/reverted state marker.

To reflect the livepatch payload ABI change, bump the version flag
LIVEPATCH_PAYLOAD_VERSION up to 2.

[And also update the top of the design document]

Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: Andra-Irina Paraschiv <andraprs@amazon.com>
Reviewed-by: Bjoern Doebel <doebel@amazon.de>
Reviewed-by: Martin Pohlack <mpohlack@amazon.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
docs/misc/livepatch.pandoc
xen/common/livepatch.c
xen/include/public/sysctl.h
xen/include/xen/livepatch.h
xen/test/livepatch/Makefile
xen/test/livepatch/xen_action_hooks.c
xen/test/livepatch/xen_action_hooks_marker.c [new file with mode: 0644]
xen/test/livepatch/xen_action_hooks_noapply.c [new file with mode: 0644]
xen/test/livepatch/xen_action_hooks_norevert.c [new file with mode: 0644]